/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package hhf.worldzones.daos;

import hhf.worldzones.entities.Continent;
import javax.ejb.Asynchronous;
import javax.ejb.Stateless;
import javax.ejb.TransactionAttribute;
import javax.ejb.TransactionAttributeType;

/**
 *
 * @author François
 */
@Stateless
public class ContinentDAO extends ZoneDAO<Continent> {
	public ContinentDAO() {
		super(Continent.class);
	}

	@TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
	@Asynchronous
	public void createContinent(String key, String label) {
		if (!contains(key)) {
			Continent continent = new Continent();
			continent.setCode(key);
			continent.setLabel(label);
			persist(continent);
		}
	}
}
